package com.cskaoyan.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author stone
 * @date 2022/06/16 17:03
 */
@Configuration
@ComponentScan("com.cskaoyan")
public class SpringConfiguration {

    @Bean
    public DataSource dataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setUrl("jdbc:mysql://localhost:3306/cskaoyan_db");
        dataSource.setUsername("root");
        dataSource.setPassword("abcdef");
        return dataSource;
    }
}
